const userDB = [
  { username: 'admin', password: 'admin', uuid: 'admin-uuid', name: '管理员' },
  { username: 'editor', password: 'editor', uuid: 'editor-uuid', name: '编辑' },
  { username: 'user1', password: 'user1', uuid: 'user1-uuid', name: '用户1' },
];
const menuData = require('../menu.json');

export default [
  {
    path: '/login',
    method: 'post',
    handle({ body }) {
      const user = userDB.find((e) => e.username === body.username && e.password === body.password);
      // if (user) {
      return {
        ...user,
        token: '8dfhassad0asdjwoeiruty',
        list: menuData.List,
        _RejCode: '00000000',
      };
      // } else {
      //   return {};
      // }
    },
  },
];
